package com.lottery.im.api.result.entity.good;

import android.databinding.BindingAdapter;
import android.text.TextUtils;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.lottery.im.R;
import com.lottery.im.api.Api;

/**
 * 作者：cyy
 * 时间：2018/10/8。
 */
public class GoodList {

  /**
   * artificial_judge_num : 0
   * good_num : 3
   * group_id : 21
   * head_img : /headImg/13.png
   * id : 41261
   * is_good : 0
   * last_ok_num : 0
   * max_win : 0
   * ratio_win :
   * setter_id : 481
   * user_name : admin41261
   */
  private int position;
  private int artificial_judge_num;
  private int good_num;
  private int group_id;
  private String head_img;
  private int id;
  private int is_good;
  private float last_ok_num;
  private int max_win;
  private String ratio_win;
  private long setter_id;
  private String user_name;

  @BindingAdapter({"goodListUrl"})
  public static void loadGoodImage(ImageView imageView,String url){
    Glide.with(imageView.getContext())
        .load(Api.BASEADDRESS+url)
        .apply(new RequestOptions()
            .placeholder(R.drawable.icon_conversation_de)
            .error(R.drawable.icon_conversation_de)
            .fitCenter()
            .override(120,120)
            .circleCrop())
        .into(imageView);
  }

  public int getPosition() {
    return position;
  }

  public void setPosition(int position) {
    this.position = position;
  }

  public int getArtificial_judge_num() {
    return artificial_judge_num;
  }

  public void setArtificial_judge_num(int artificial_judge_num) {
    this.artificial_judge_num = artificial_judge_num;
  }

  public int getGood_num() {
    return good_num;
  }

  public void setGood_num(int good_num) {
    this.good_num = good_num;
  }

  public int getGroup_id() {
    return group_id;
  }

  public void setGroup_id(int group_id) {
    this.group_id = group_id;
  }

  public String getHead_img() {
    return head_img;
  }

  public void setHead_img(String head_img) {
    this.head_img = head_img;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public int getIs_good() {
    return is_good;
  }

  public void setIs_good(int is_good) {
    this.is_good = is_good;
  }

  public float getLast_ok_num() {
    return last_ok_num;
  }

  public void setLast_ok_num(float last_ok_num) {
    this.last_ok_num = last_ok_num;
  }

  public int getMax_win() {
    return max_win;
  }

  public void setMax_win(int max_win) {
    this.max_win = max_win;
  }

  public String getRatio_win() {
    if(TextUtils.isEmpty(ratio_win)){
      return "0";
    }else{
      return ratio_win;
    }
  }

  public void setRatio_win(String ratio_win) {
    this.ratio_win = ratio_win;
  }

  public long getSetter_id() {
    return setter_id;
  }

  public void setSetter_id(long setter_id) {
    this.setter_id = setter_id;
  }

  public String getUser_name() {
    return user_name;
  }

  public void setUser_name(String user_name) {
    this.user_name = user_name;
  }
}
